// 此模块：是轮播图的请求封装

import type { IBanner } from "@/myTypes";
import service from "../utils/service.ts";

// 获取轮播图的列表
export function getBannerListApi(){
    return service({
        url:"/banner/list"
    })
}

// 添加轮播图

export function addBannerApi(banner:IBanner){
    return service({
        url:"/banner/add",
        method:"post",
        data:banner
    })
}

// 删除单条轮播图

export function deleteBannerByIdApi(bannerid:string){
    return service({
        url:"/banner/delete",
        params:{
            bannerid
        }
    })
}

// 修改轮播图的访问状态

export function updateFlagApi(bannerid:string,flag:boolean){
    return service({
        url:"/banner/updateFlag",
        method:"post",
        data:{
            bannerid,flag
        }
    })
}